package com.nanoso.service.jms;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.TextMessage;

public class MessageConverter {

	public Long convertMessage2Long(Message message, String propertyName) {
		TextMessage m = (TextMessage) message;
		Long res = 0L;
		try {
			res = m.getLongProperty(propertyName);
		} catch (JMSException e) {
			e.printStackTrace();
		}
		return res == null ? 0L : res;
	}
}
